package com.zenghus.jdbccore.impl;

import java.util.List;

import com.zenghus.jdbccore.BaseDao;
import com.zenghus.jdbccore.BaseMapper;

public abstract class BaseDaoImpl implements BaseDao {
	
	public abstract BaseMapper getMapper();

	
	public <T> void add(T t){
	    getMapper().add(t);
	}
	
	public <T> void update(T t){
		getMapper().update(t);
	}
	
	public <T> void delete(Object... ids){
		if(ids == null || ids.length < 1){
			return;
		}
		for(Object id : ids ){
			getMapper().delete(id);
		}
	}
	
	
	public <T> List<T> queryByList(Object obj){
		return getMapper().queryByList(obj);
	}

	public <T> T queryById(Object id){
		return getMapper().queryById(id);
	}
}
